﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Meant to calculate indexnumbers for integer values
/// </summary>
public class IndexNumbers
{
  private int yearBase, yearOne, yearTwo, yearThree, yearFour, yearFive, yearSix;

  public int indexYearBase { get; set; }

  public int[] indexNumbers { get; set; }

  public IndexNumbers(int yearBase, int yearOne, int yearTwo, int yearThree, int yearFour, int yearFive, int yearSix)
	{
    this.yearBase = yearBase;
    this.yearOne = yearOne;
    this.yearTwo = yearTwo;
    this.yearThree = yearThree;
    this.yearFour = yearFour;
    this.yearFive = yearFive;
    this.yearSix = yearSix;
    calIndexNumbers();
	}

  private void calIndexNumbers()
  {
    indexNumbers = new int[6];

    indexYearBase = 100;
    indexNumbers[0] = yearOne * 100 / yearBase;
    indexNumbers[1] = yearTwo * 100 / yearBase;
    indexNumbers[2] = yearThree * 100 / yearBase;
    indexNumbers[3] = yearFour * 100 / yearBase;
    indexNumbers[4] = yearFive * 100 / yearBase;
    if (yearSix != 0) indexNumbers[5] = yearSix * 100 / yearBase;
  }
}